<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>添加商店</title>
	<!-- Tell the browser to be responsive to screen width -->
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<!-- Bootstrap 3.3.6 -->
	<link rel="stylesheet" href="${siteurl}bootstrap/css/bootstrap.min.css">
	<!-- Font Awesome -->
	<link rel="stylesheet" href="${siteurl}plugins/FontAwesome/css/font-awesome.min.css">
	<!-- Ionicons -->
	<link rel="stylesheet" href="${siteurl}plugins/ionicons201/css/ionicons.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="${siteurl}dist/css/AdminLTE.min.css">
	<!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
	<link rel="stylesheet" href="${siteurl}dist/css/skins/_all-skins.min.css">

	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
	<![endif]-->
	[#include "/admin/common/commons.html"]

	<!-- jQuery 2.2.3 -->
	<script src="${siteurl}plugins/jQuery/jquery-2.2.3.min.js"></script>
	<!-- Bootstrap 3.3.6 -->
	<script src="${siteurl}bootstrap/js/bootstrap.min.js"></script>
	<!-- SlimScroll -->
	<script src="${siteurl}plugins/slimScroll/jquery.slimscroll.min.js"></script>
	<!-- FastClick -->
	<script src="${siteurl}plugins/fastclick/fastclick.js"></script>
	<!-- AdminLTE App -->
	<script src="${siteurl}dist/js/app.min.js"></script>
	<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=PYWBZ-QHE3I-L7WGT-5THCC-KOPH7-Y6FSC"></script>
	[#include "/admin/common/fileuploads.html"]
	<style type="text/css">
		.form-group label{
			padding-right: 0px;
			padding-left: 0px;
		}
		.positioning{
			z-index: 100;
			position: absolute;
			top:5px;
			right: 30px;
			width:15px;
			height:20px;
		}
	</style>
</head>
<body class="hold-transition skin-blue sidebar-mini" onload="init()">
<!-- Site wrapper -->
<div class="wrapper">

	<header class="main-header">
		<!-- Header Navbar: style can be found in header.less -->
		[#include "/admin/common/nav.html"]
	</header>

	<!-- =============================================== -->

	<!-- Left side column. contains the sidebar -->
	<aside class="main-sidebar">
		<!-- sidebar: style can be found in sidebar.less -->
		<section class="sidebar">
			<!-- Sidebar user panel -->
			[@user_panel /]
			<!-- search form -->
			[@sidebar_form /]
			<!-- /.search form -->
			<!-- sidebar menu: : style can be found in sidebar.less -->
			<ul class="sidebar-menu">
				<li class="header">主面板</li>
				[@menustag id=1]
				[#list list as item]
				[@menu item "1,33,34"]
				[/@menu]
				[/#list]
				[/@menustag]
			</ul>
		</section>
		<!-- /.sidebar -->
	</aside>

	<!-- =============================================== -->

	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>
				商店管理
				<small>添加商店</small>
			</h1>
		</section>
		<!-- Main content -->
		<section class="content">

			<!-- Default box -->
			<div class="col-xs-12">
				<div class="box box-default box-solid">
					<div class="box-header with-border">
						<h3 class="box-title">商店</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->
					<form class="form-horizontal" action="${siteurl}admin/shop/model_save.htm" method="post">
						<input type="hidden" id="lng" name="lng" value="">
						<input type="hidden" id="lat" name="lat" value="">

						<input type="hidden" name="pageNumber" value="${pageNumber!'1'}">
						<div class="box-body">
							<div class="form-group col-lg-6">
								<label for="name" class="col-sm-2 control-label"><span class="required">*</span>场馆名称</label>
								<div class="col-sm-10">
									<input value="" required="required" class="form-control" id="name" name="name" placeholder="场馆名称" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="catalog" class="col-sm-2 control-label"><span class="required">*</span>场馆类型</label>
								<div class="col-sm-10">
									<select id="catalog" name="catalog.id" class="form-control">
									</select>
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="charge" class="col-sm-2 control-label"><span class="required">*</span>负责人</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="charge" name="charge" placeholder="负责人" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="backMoney" class="col-sm-2 control-label">返款金额</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="backMoney" name="backMoney" placeholder="返款金额" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="phone" class="col-sm-2 control-label"><span class="required">*</span>联系电话</label>
								<div class="col-sm-10">
									<input value="" required="required" class="form-control" id="phone" name="phone" placeholder="联系电话" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="bankNo" class="col-sm-2 control-label">银行卡号</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="bankNo" name="bankNo" placeholder="银行卡号" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="bankAccount" class="col-sm-2 control-label">持卡人</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="bankAccount" name="bankAccount" placeholder="持卡人" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="bankName" class="col-sm-2 control-label">开户银行</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="bankName" name="bankName" placeholder="开户银行" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="brand" class="col-sm-2 control-label">品牌</label>
								<div class="col-sm-10">
									<select id="brand" name="brand.id" class="form-control">
										<option value="">无品牌</option>
									</select>
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="venueType" class="col-sm-2 control-label">运营方式</label>
								<div class="col-sm-10">
									<select id="venueType" name="venueType" class="form-control">
										<option value="single">个体户</option>
										<option value="league">加盟</option>
										<option value="selfsupport">自营</option>
									</select>
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="rebate" class="col-sm-2 control-label">折扣</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="rebate" name="rebate" placeholder="折扣,不填写不打折" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="zoom" class="col-sm-2 control-label">地图等级</label>
								<div class="col-sm-10">
									<select id="zoom" name="zoom"  class="form-control">
										[#list 18..6 as item]
										<option value="${item}"  >${item!""}</option>
										[/#list]
									</select>
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="boss" class="col-sm-2 control-label">老板姓名</label>
								<div class="col-sm-10">
									<input  class="form-control" id="boss" name="boss" placeholder="老板姓名" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label for="openId" class="col-sm-2 control-label">老板Id</label>
								<div class="col-sm-10">
									<input  class="form-control" id="openId" name="openId" placeholder="老板微信openId" type="text">
								</div>
							</div>
							<div class="form-group col-lg-6">
								<label  class="col-sm-2 control-label">到账比例</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="rate" name="rate" placeholder="到账比例" type="text">
								</div>
							</div>
							<div class="form-group col-lg-12">
								<label for="logo" class="col-sm-1 control-label"><span class="required">*</span>场馆门头</label>
								<div class="col-sm-10">
								</div>
							</div>
							<div class="form-group col-lg-12">
								<label for="privilege" class="col-lg-1 control-label">会员特权</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="privilege" name="privilege" placeholder="会员特权" type="text" />
								</div>
							</div>

							<div class="form-group col-lg-12">
								<label for="note" class="col-lg-1 control-label">场馆详情</label>
								<div class="col-sm-10">
									<textarea  class="form-control" id="note" name="note" placeholder="场馆详情" type="text"></textarea>
								</div>
							</div>
							<div class="form-group col-lg-12">
								<label for="address" class="col-lg-1 control-label">店铺地址</label>
								<div class="col-sm-10">
									<input value="" class="form-control" id="address" name="address" placeholder="店铺地址" type="text">
									<img id="poi" class="positioning" src="${siteurl}dist/img/positioning.png" alt="">
								</div>
							</div>
							<div class="form-group col-lg-12">
								<label for="map" class="col-lg-1 control-label">地图</label>
								<div class="col-sm-10" >
									<div id="map" style="height: 300px;"></div>
								</div>
							</div>
						</div>
						<!-- /.box-body -->
						<div class="box-footer">
							<button type="submit" class="btn btn-primary pull-right">保存</button>
						</div>
						<!-- /.box-footer -->
					</form>
				</div>
			</div>
			<!-- /.box -->

		</section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->

	[#include "/admin/common/footer.html"]

	<!-- Control Sidebar -->
	[#include "/admin/common/aside.html"]

	<!-- /.control-sidebar -->
	<!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
	<div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<script type="text/javascript">
	var citylocation,map,marker = null;
	var init = function() {
		var center = new qq.maps.LatLng('34.33422273578077','108.9480471611023');
		map = new qq.maps.Map(document.getElementById('map'),{
			center: center,
			zoom: 19
		});
		//获取城市列表接口设置中心点
		citylocation = new qq.maps.CityService({
			complete : function(result){
				map.setCenter(result.detail.latLng);
			}
		});
		//调用searchLocalCity();方法    根据用户IP查询城市信息。
		//citylocation.searchLocalCity();

		qq.maps.event.addListener(
				map,
				'click',
				function(event) {
					$("#lat").val(event.latLng.getLat())
					$("#lng").val(event.latLng.getLng())
					if(marker!=null){
						marker.setMap(null);
					}
					center= new qq.maps.LatLng(event.latLng.getLat(),event.latLng.getLng());
					marker = new qq.maps.Marker({
						position: center,
						map: map
					});
					map.setCenter(center);
				}
		);
		//创建标记
		marker = new qq.maps.Marker({
			position: center,
			map: map
		});
	}

	function geolocation_ip() {
		var clientip = document.getElementById("client_ip").value;
		var city = document.getElementById("city");
		//调用查询ip接口查询信息
		citylocation.searchCityByIP(clientip);
	}

	$(document).ready(function () {
		$("#poi").click(function () {
			var params={};
			params.address=$("#address").val();
			$.post("${siteurl}rest/lbs/search.htm",params,function (back) {
				if (back.code==0){
					console.log(back);
					$("#lat").val(back.lat)
					$("#lng").val(back.lng)
					if(marker!=null){
						marker.setMap(null);
					}
					center= new qq.maps.LatLng(back.lat,back.lng);
					marker = new qq.maps.Marker({
						position: center,
						map: map
					});
					map.setCenter(center);

				}
			});
		});
	});
</script>
</body>
</html>
